<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<script>
	function id_check() {
		document.getElementById("join").action = "idCheck";
		document.getElementById("join").submit();
	}
	function pw_check() {
		if (document.getElementById("pw1").value == document
				.getElementById("pw2").value) {
			document.getElementById("join").submit();
		} else {
			window.alert("비밀번호를 확인하세요.");
		}
	}
</script>

<div id="join_page">
	<header>
		<div id="title">
			<b>[회원 가입]</b>
		</div>

		<div id="bar"></div>
	</header>

	<section id="join_form">
		<form:form id="join" action="memberJoin" modelAttribute="member">
			<form:errors path="*" cssClass="error" />
			<fieldset>
				<legend>사용자 기본정보</legend>
				<label>사용자 ID</label> <select name=seqId>
					<option value="S0000000">학생</option>
					<option value="E0000000">연구원</option>
					<option value="T0000000">강사</option>
				</select>
				<form:input id="uid" path="memberId" type="text" class="id" />
				<input name="b_checkdup" type="button" value="중복체크" class="dup"
					onclick="id_check()" /> ${idChecking} <br> <label>패스워드</label>
				<form:input id="pw1" path="memberPassword" type="password"
					class="pass" />
				<br> <label>패스워드(재입력)</label> <input id="pw2" name="repass"
					type="password" class="pass" /><br> <label>이름</label>
				<form:input path="name" type="text" class="name" />
				<br> <label>성별</label> <input type=radio name=gender value="M"
					checked="checked"> 남자 <input type=radio name=gender
					value="F"> 여자<br> <label>생년월일</label>
				<form:input path="dateOfBirth" type="text" class="birth" />
				0000-00-00 <br> <label>연락처</label>
				<form:input path="phoneNumber" type="tel" class="phone" />
				000-0000-0000 <br> <label>이메일</label>
				<form:input path="email" type="email" class="email" />
				<br>
			</fieldset>

			<fieldset>
				<legend>사용자 (추가정보)</legend>
				<label>대학교</label>
				<form:input path="university" type="text" class="university" />
				<br> <label>전공</label>
				<form:input path="major" type="text" class="major" />
				<br> <label>졸업연도</label>
				<form:input path="graduatedYear" type="text" class="graduate" />
				0000-00-00 <br> <label>주소</label>
				<form:input path="address" type="text" class="address" />
				<br>
			</fieldset>

			<div class="clear"></div>
			<div id="buttons">
				<input name="b_submit" type="button" value="Submit" class="submit"
					onclick="pw_check()">
			</div>
		</form:form>
	</section>
</div>